package org.example.app.web.api;

import io.swagger.v3.oas.annotations.Operation;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.example.app.web.vm.BookKeepVm;
import org.springframework.web.bind.annotation.*;

public interface BookKeepController {

    @Operation(summary = "创建账单")
    String create(@RequestBody BookKeepVm bookKeepVm, HttpServletRequest request);

    @Operation(summary = "获取当前用户全部账单")
    String getAccounts(HttpServletRequest request);

    @Operation(summary = "删除账单")
    String delete(@PathVariable Integer id, HttpServletRequest request);

    // ========== 你需要新增的接口 ==========

//    @Operation(summary = "根据月份获取账单")
//    @GetMapping("/bookkeep/byMonth")
//    String getByMonth(@RequestParam int year, @RequestParam int month, HttpServletRequest request);
//
//    @Operation(summary = "根据金额范围获取账单")
//    @GetMapping("/bookkeep/byAmount")
//    String getByAmount(@RequestParam double min, @RequestParam double max, HttpServletRequest request);
//
//    @Operation(summary = "根据月份和金额范围获取账单")
//    @GetMapping("/bookkeep/byMonthAndAmount")
//    String getByMonthAndAmount(@RequestParam int year, @RequestParam int month,
//                               @RequestParam double min, @RequestParam double max,
//                               HttpServletRequest request);
//
    @Operation(summary = "获取收入与支出统计")
    @GetMapping("/bookkeep/statistics")
    String getStatistics(HttpServletRequest request);
//
//    @Operation(summary = "获取指定年份的收入与支出统计")
//    @GetMapping("/bookkeep/statistics/year")
//    String getYearlyStatistics(@RequestParam int year, HttpServletRequest request);
//
    @Operation(summary = "导出账单数据（按年或月）")
    @GetMapping("/bookkeep/export")
    void exportBookKeepData(@RequestParam(required = false) Integer year,
                              @RequestParam(required = false) Integer month,
                              HttpServletRequest request,
                              HttpServletResponse response);
}
